DecodeARC

SoftwareShield COM-Activator™ Component > COM-Activator™ Reference > DecodeARC

## DecodeARC

The DecodeARC function decodes an Authorization Request Code by validating its format, extracting its embedded values and extracting the Authorization Definition values stored inside the license to which it corresponds.

###### Syntax

HRESULT DecodeARC (

BSTR LPJFileNamePath,

BSTR AuthRequestCode,

long * EmbeddedFingerPrint,

long * AuthID,

long * AuthType,

long * AuthParamType,

BSTR * AuthDescription,

BSTR * AuthParamDescription,

long * AuthParamPresetValue,

BSTR * AuthPassword,

long * AuthDefaultShelfLife,

VARIANT_BOOL * AuthSingleUseFlag,

long * AuthPreConditionID,

long * ACG_return_code

);

###### Parameters

LPJFileNamePath

[IN] This is a wide string value that indicates the full path and filename of the license project file to use to decode the Authorization Request Code. The file must exist and must be an .LPJ file.

AuthRequestCode

[IN] This is a wide string value that must contain the Authorization Request Code to decode.

EmbeddedFingerPrint

[OUT] This is (a pointer to) a numeric value that returns holding the 26-bit embedded FingerPrint value that was extracted from the Authorization Request Code (if the call was successful). See remarks below for more information.

AuthID

[OUT] This is (a pointer to) a numeric value that returns holding the Authorization Definition ID in the license project which corresponds to the Authorization Request Code (if the call was successful). See remarks below for more information.

AuthType

[OUT] This is (a pointer to) a numeric value that returns holding a ACG_AUTH_DEF_TYPE. This value indicates the type of Authorization Definition which the Authorization Request Code represents (if the call was successful). See remarks below for more information.

AuthParamType

[OUT] This is (a pointer to) a numeric value that returns holding a ACG_PARAM_TYPE. This value indicates the type of parameter which the Authorization Definition that corresponds to the Authorization Request Code represents (if the call was successful). See remarks below for more information.

AuthDescription

[OUT] This is (a pointer to) a wide string value that returns holding the description that is entered in the license project file for the Authorization Definition (if any) which corresponds to the Authorization Request Code (if the call was successful). See remarks below for more information.

AuthParamDescription

[OUT] This is (a pointer to) a wide string value that returns holding the parameter description that is entered in the license project file for the Authorization Definition (if any) which corresponds to the Authorization Request Code (if the call was successful). See remarks below for more information.

AuthParamPresetValue

[OUT] This is (a pointer to) a numeric value that returns holding the preset parameter value entered in the license project file for the Authorization Definition (if any) which corresponds to the Authorization Request Code (if the call was successful). See remarks below for more information.

AuthPassword

[OUT] This is (a pointer to) a wide string value that returns holding the Authorization Definition password that is entered in the license project file for the Authorization Definition which corresponds to the Authorization Request Code (if the call was successful). See remarks below for more information.

AuthDefaultShelfLife

[OUT] This is (a pointer to) a numeric value that returns holding the default Shelf-Life for the Authorization Definition which the Authorization Request Code represents (if the call was successful). See remarks below for more information.

AuthSingleUseFlag

[OUT] This is (a pointer to) a boolean value that returns holding the Single-Use flag for the Authorization Definition which the Authorization Request Code represents (if the call was successful). See remarks for more information.

AuthPreConditionID

[OUT] This is (a pointer to) a numeric value that returns holding Authorization Definition ID which represents the pre-condition linked to the Authorization Request Code (if the call was successful). See remarks for more information.

ACG_return_code

[OUT] This is (a pointer to) a numeric value that returns with a ACG_RETURN_CODE that identifies the outcome of the operation. See remarks below for more information.

###### Remarks

Use DecodeARC to extract the parts embedded inside the Authorization Request Code and look up the details of the Authorization Definition inside a license to which the Authorization Request Code corresponds.

When DecodeARC is called, the ACG_return_code parameter will return holding ACG_FALSE_MISSING_MAIN_LF if the LPJFileNamePath parameter does not indicate a file that exists. If the license project file exists, but is an invalid filename, it returns holding ACG_FALSE_BAD_MAIN_LF_FILENAME. If the License project exists and seems to be the correct format but an error occurred during loading it returns holding ACG_FALSE_MAIN_LF_CORRUPT.

If the license project is successfully loaded, the ACG_return_code parameter will return holding ACG_TRUE_FORMAT_OK if the Authorization Request Code was valid, and represented a valid Authorization Definition in the license. It will return holding the special value ACG_TRUE_DEACTIVATED, if the Authorization Request Code was actually a Deactivation Confirmation Code. If the call is successful, (returns holding ACG_TRUE_FORMAT_OK or ACG_TRUE_DEACTIVATED), then the remaining reference parameters return holding the information extracted from the Authorization Request Code and the corresponding Authorization Definition information extracted from the license.

If the license project is successfully loaded, the ACG_return_code parameter will return holding ACG_FALSE_CODE_BAD_FORMAT if the Authorization Request Code was invalid.

If the license project is successfully loaded, the ACG_return_code parameter will return holding ACG_FALSE_CODE_INVALID_BAD_ID if the Authorization Request Code contained an Authorization ID that is not valid for the license.

Use this function to decode an Authorization Request Code to determine how to construct the parameter you require to generate and return an Activation Code using one of the GenActCodexxx functions. Once you call this function, you can inspect the AuthType and AuthParamType reference parameters to determine the type of Authorization Definition the request represents and the parameter type to use.

###### Example

We call DecodeARC on an Authorization Request Code and find that it returns an AuthType of ADT_CHANGEEXPIRY which has a AuthParamType of PTYPE_DATE. From this we know that if we choose to generate an Activation Code, we must call either GenActCodeDateParam or GenActCodeDateParamFP to generate an Activation Code that takes a date parameter.

###### Return Value

As with all COM function calls they return an HRESULT. HRESULT is a data type that is a 32-bit error or warning code. Check your compilers documentation for information on interpreting the HRESULT value.

###### Function Information

Exposed By Interface: | "ISSCodeGenerator"
Exposed In COM Server Binary: | "SSCGen.dll"

Note: The COM Activator only comes with the Enterprise, Internet and Server Editions of the SoftwareShield DRM Kit.